﻿using System.Collections.Generic;
using Mbs.Collections;

namespace Mbs.Messaging
{
    /// <summary>
    /// 
    /// </summary>
    public interface ISubject:IPublisher
    {
        string Name { get; set; }
        void Close();
    }

    public interface ISubject<TMessage> : ISubject,IPublisher<TMessage>
    {
        event ObserverHandler<TMessage> Observers;
        event PreFilterHandler<TMessage> PreFilters;
        event FilterHandler<TMessage> Filters;

        ISubscriber<TMessage> Subscriber { get; set; }

        IQueue<KeyValuePair<object,TMessage>> Queue { get; set; }
        IExecutor<TMessage> Executor { get; set; }

        bool Closed { get; }
    }
}
